import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'
import craeteIndexStore from './modules/index/index'
import createRankStore from './modules/rank'
import * as types from './mutation-types'
Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export function createStore () {
  return new Vuex.Store({
    state: {
      headerVisible: true
    },
    getters: {
    },
    mutations: {
      [types.SET_HEADER] (state, payload) {
        state.headerVisible = payload
      }
    },
    actions: {
    },
    modules: {
      index: craeteIndexStore(),
      rank: createRankStore()
    },
    strict: debug,
    plugins: debug ? [createLogger()] : []
  })
}
